package com.top.ruizhong.main.host.adpter

import android.widget.ImageView
import com.blankj.utilcode.util.ConvertUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.module.lemlin.base.loadRoundImage
import com.top.ruizhong.R
import com.top.ruizhong.entity.VideoDraft

class VideoWorksAdapter : BaseQuickAdapter<VideoDraft, BaseViewHolder>(R.layout.item_works) {

    var status: Int = 0

    init {
        addChildClickViewIds(R.id.tvWorksDelete,R.id.tvWorksReason,R.id.tvWorksEdit)
    }

    override fun convert(holder: BaseViewHolder, item: VideoDraft) {
        holder.setText(R.id.tvWorksTitle, item.title)
            .setText(R.id.tvWorksDesc, item.description)
            .setGone(R.id.llWorksStatus, status != 3)
            .getView<ImageView>(R.id.ivWorksImage)
            .loadRoundImage(item.main_image, ConvertUtils.dp2px((10f)))
    }
}